class Orders < ActiveRecord::Base
validates_presence_of :clientID
validates_presence_of :employeeID
validates_presence_of :itemID
validates_length_of :clientID, :minimum => 1
validates_length_of :employeeID, :minimum => 1
validates_length_of :itemID, :minimum => 1
def self.processing_orders
 find(:all, :conditions => "description = 'processing'", :order => "created_at" )
end

def self.completed_orders
 find(:all, :conditions => "description = 'completed'", :order => "updated_at" )
end

def self.cancelled_orders
 find(:all, :conditions => "description = 'cancelled'", :order => "updated_at" )
end

  
end

